using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using Backend.JYD.Model.Bid;

namespace Backend.JYD.EFDAL.Mapping
{
    public class InviteInfoMap : EntityTypeConfiguration<InviteInfo>
    {
        public InviteInfoMap()
        {
            // Primary Key
            this.HasKey(t => t.InviteId);

            // Properties
            this.Property(t => t.InviteId)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            this.Property(t => t.CustNo)
                .IsRequired()
                .HasMaxLength(20);

            this.Property(t => t.SafeSource)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("InviteInfo");
            this.Property(t => t.InviteId).HasColumnName("InviteId");
            this.Property(t => t.IntentId).HasColumnName("IntentId");
            this.Property(t => t.CustNo).HasColumnName("CustNo");
            this.Property(t => t.LoanMoney).HasColumnName("LoanMoney");
            this.Property(t => t.Term).HasColumnName("Term");
            this.Property(t => t.Rate).HasColumnName("Rate");
            this.Property(t => t.Type).HasColumnName("Type");
            this.Property(t => t.Status).HasColumnName("Status");
            this.Property(t => t.CreateTime).HasColumnName("CreateTime");
            this.Property(t => t.UpdateTime).HasColumnName("UpdateTime");
            this.Property(t => t.OpId).HasColumnName("OpId");
            this.Property(t => t.SafeType).HasColumnName("SafeType");
            this.Property(t => t.SafeSource).HasColumnName("SafeSource");
            this.Property(t => t.BidStartDate).HasColumnName("BidStartDate");
            this.Property(t => t.BidEndDate).HasColumnName("BidEndDate");
            this.Property(t => t.BidAmount).HasColumnName("BidAmount");
            this.Property(t => t.PlanType).HasColumnName("PlanType");
            this.Property(t => t.AccId).HasColumnName("AccId");
        }
    }
}
